package com.globallogic.training.vaskulg.binarytree;

import static org.junit.Assert.*;

import org.junit.Before;
import org.junit.Test;

public class BinaryTreeToStringTester {
	private BinaryTree<String> testTree;

	@Before
	public void setUp() throws Exception {
		testTree = new BinaryTree<String>("Value of Top Node");
	}
	
	@Test
	public void shouldHaveRootNodeInToString() {
		assertTrue(testTree.toString().contains("Root Node"));
	}
	
	@Test
	public void shouldHaveValueOfRootNodeInToString() {
		assertTrue(testTree.toString().contains("Value of Top Node"));
	}
	
	@Test
	public void shouldHaveLeftChildInToString() {
		// When
		testTree.addLeftNode("Left Node value");
		
		assertTrue(testTree.toString().contains("Left Node value"));
	}
	
	@Test
	public void shouldHaveRightChildInToString() {
		// When
		testTree.addRightNode("Right Node value");
		
		assertTrue(testTree.toString().contains("Right Node value"));
	}
}
